<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <meta
      name="description"
      content="汇融名企是面向全国商家服务的大型互联网平台，为商家提供流量扶持，引导品牌曝光；为消费者提供风云榜单，招商加盟，引导实现消费，达成合作，上汇融名企实现共赢。"
    />
    <link rel="stylesheet" href="./css/common.css" />
    <link rel="stylesheet" href="./css/merchantsJoin.css" />
    <link rel="stylesheet" href="./css/sentimentLeft.css" />
    <link rel="stylesheet" href="./css/sentimentRight.css" />
    <link rel="stylesheet" href="./css/sentimentBanner.css" />
    <link rel="stylesheet" href="./css/carousel.css" />
    <title>火热招商-汇融名企</title>
  </head>
  <body>
    <!-- <div id="header-page"></div> -->
    <!--#include virtual="/header.html" -->
    <!--右侧悬浮品牌加盟-->
    <div class="brand-join-right">
      <img
        class="brand-join-close"
        id="brand-close"
        src="./image/icon/index_gban_icon.png"
        alt="招商加盟-汇融名企"
      />
      <img
        id="brand-join-img"
        src="./image/picture/index_ycxf_img.png"
        alt="招商加盟-汇融名企"
      />
    </div>
    <div class="banner-top-line"></div>
    <!--banner-->
    <div class="top-carousel">
      <div class="pb-carouselWarp carousel carousel-banner">
        <ul class="pb-carousel" id="banner-1"></ul>
        <ul class="pb-carousel-ind" id="banner-1-point"></ul>
      </div>
    </div>
    <!--广告-->
    <div
      class="banner-wrapper wrapper"
      style="height: 342px;"
      id="banner-wrapper"
    ></div>
    <!--热门品牌-->
    <div class="hot-brand">
      <div class="hot-brand-item-wrapper">
        <div
          class="hot-brand-item-container"
          id="hot-brand-item-container"
        ></div>
      </div>
    </div>
    <!--广告-->
    <div
      class="banner-wrapper wrapper"
      style="height: 256px;"
      id="banner-wrapper2"
    ></div>
    <!--加盟流程-->
    <!-- <div class="merchantsJoin-process wrapper"></div> -->
    <!--招商加盟-->
    <div class="wrapper">
      <div class="title" style="margin-top: 20px;">
        <div style="position: relative;">
          <img
            src="./image/picture/index_title_investment.png"
            alt="招商加盟-汇融名企"
          />
          <div class="title-more">
            <a href="./merchantsJoinList.html"> MORE <span>></span></a>
          </div>
        </div>
        <div class="title-divider-wrapper">
          <div class="title-divider-colorbar"></div>
          <div class="title-divider"></div>
        </div>
      </div>
      <div class="investment">
        <div class="investment-img"></div>
        <div class="brand-wrapper" id="brand-wrapper"></div>
      </div>
    </div>
    <div
      class="banner-wrapper wrapper"
      style="height: 342px;"
      id="banner-wrapper3"
    ></div>
    <div class="page-mid-banner"></div>
    <!--人气加盟-->
    <div class="wrapper" style="margin-top: 50px;">
      <div class="title" style="margin-top: 20px;">
        <div style="position: relative;">
          <img
            src="./image/picture/index_title_popularity.png"
            alt="人气加盟-汇融名企"
          />
          <div class="title-more">
            <a href="./merchantsJoinList.html"> MORE <span>></span></a>
          </div>
        </div>
        <div class="title-divider-wrapper">
          <div class="title-divider-colorbar"></div>
          <div class="title-divider"></div>
        </div>
      </div>
      <div class="popularity-wrapper wrapper">
        <div class="popularity-container" id="popularity-container"></div>
      </div>
      <!--品牌招商-->
      <div class="hot-merchantsJoin" id="hot-merchantsJoin-box">
        <div class="hot-merchantsJoin-form">
          <h1>
            今日已有
            <span><i id="join-number">65</i>位</span> 代理商提交加盟信息
          </h1>
          <div class="join-scroll">
            <ul id="div-hot-merchantsJoin"></ul>
          </div>
          <p>
            <span>您的姓名：</span>
            <input placeholder="请输入姓名" type="text" id="your_name" />
            <span>您的联系方式：</span>
            <input placeholder="请输入联系方式" type="text" id="your_tel" />
          </p>
          <div class="select-city-prov">
            <span>代理省份：</span>
            <div id="div-select-city"></div>
          </div>
          <div class="hot-merchantsJoin-form-submit">
            <img
              id="form-submit"
              src="./image/picture/hot_merchantsJoin_form_submit.png"
              alt="品牌招商-汇融名企"
            />
          </div>
        </div>
      </div>
      <div class="clear"></div>
    </div>
    <!--广告-->
    <div
      class="banner-wrapper wrapper"
      id="banner-wrapper4"
      style="padding-bottom: 0; height: 86px;"
    ></div>
    <!--优质招商-->
    <div class="title wrapper" style="margin-top: 45px;">
      <div style="position: relative;">
        <img src="./image/picture/index_yzzs_img.png" alt="优质招商-汇融名企" />
        <div class="title-more">
          <a href="./merchantsJoinList.html"> MORE <span>></span></a>
        </div>
      </div>
      <div class="title-divider-wrapper">
        <div class="title-divider-colorbar"></div>
        <div class="title-divider"></div>
      </div>
    </div>
    <div class="quality-investment wrapper">
      <div class="sentiment-left">
        <ul id="sentiment-left"></ul>
      </div>
      <div class="clear"></div>
      <div class="sentiment-banner">
        <div class="sentiment-carousel">
          <div class="pb-carouselWarp carousel">
            <ul class="pb-carousel" id="banner-1"></ul>
            <ul class="pb-carousel-ind" id="banner-1-point"></ul>
          </div>
        </div>
      </div>
    </div>
    <div class="clear"></div>
    <div id="merchants-img" style="height: 274px;" class="wrapper"></div>
    <div id="merchants-img-small" style="height: 171px;" class="wrapper"></div>
    <!--最新招商信息-->
    <div class="title wrapper" style="margin-top: 45px;">
      <div style="position: relative;">
        <img
          src="./image/picture/index_zxzsxx_img.png"
          alt="最新招商-汇融名企"
        />
        <div class="title-more">
          <a href="./merchantsJoinList.html"> MORE <span>></span></a>
        </div>
      </div>
      <div class="title-divider-wrapper">
        <div class="title-divider-colorbar"></div>
        <div class="title-divider"></div>
      </div>
    </div>
    <div class="merchants-new-detail wrapper">
      <div class="sentiment-right merchantsDet-left inline-block">
        <table class="sentiment-table-th">
          <tr>
            <td><p style="width: 60px;">联系人</p></td>
            <td><p style="width: 176px;">代理地区</p></td>
            <td><p style="width: 360px;">代理详情</p></td>
            <td align="center"><p style="width: 120px;">门店面积</p></td>
            <td align="center"><p style="width: 82px;">预计投资金额</p></td>
          </tr>
        </table>

        <div class="myscroll left">
          <ul id="div-merchantsDetail-left"></ul>
        </div>
      </div>
      <div class="sentiment-right merchantsDet-right inline-block">
        <table class="sentiment-table-th">
          <tr>
            <td><p style="width: 53px;">联系人</p></td>
            <td><p style="width: 120px;">代理地区</p></td>
            <td><p style="width: 260px;">咨询内容</p></td>
            <td><p style="width: 100px;"></p></td>
          </tr>
        </table>

        <div class="myscroll">
          <ul id="div-merchantsDetail-right"></ul>
        </div>
      </div>
    </div>
    <div class="clear"></div>
    <!--广告-->
    <div id="merchants-img-footer" style="height: 274px;" class="wrapper"></div>
    <div
      id="merchants-img-smallfooter"
      style="height: 171px;"
      class="wrapper"
    ></div>
    <!--底部-->
    <div class="footer footer-form" style="margin-top: 200px;">
      <div class="cooperation-form" id="cooperationForm">
        <div class="wrapper">
          <img
            src="./image/icon/index_xdgban_icon.png"
            class="close-cooperation"
            id="closeCooperation"
            alt="品牌加盟-汇融名企"
          />
          <div class="cooperation-form-con">
            <input
              id="your_nameFooter"
              style="width: 144px;"
              placeholder="请输入姓名"
              type="text"
            />
            <input
              id="your_telFooter"
              style="width: 190px;"
              placeholder="请输入联系方式"
              type="text"
            />
            <div id="div-footer-city" class="inline-block"></div>
            <!-- <input placeholder="代理省份" type="text" />
            <input placeholder="代理市区 " type="text" />
            <input placeholder="代理区/县" type="text" /> -->

            <div class="hot-merchantsJoin-form-submit">
              <img
                id="form-submit-footer"
                src="./image/picture/index_ljtjan_icon.png"
                alt="品牌加盟-汇融名企"
              />
            </div>
          </div>
        </div>
      </div>
      <div class="footer-bottom">
        <div id="statistical"></div>
        <p>欢迎访问<strong>汇融名企</strong>，汇融名企等您加入！</p>
      </div>
    </div>
    <script src="./js/jquery-1.11.0.min.js"></script>
    <script src="./js/jquery.tmpl.min.js"></script>
    <script src="./js/utils.js"></script>
    <script src="./js/api.js"></script>
    <script src="./js/scroll.js"></script>
    <script src="./js/carousel.min.js"></script>
    <script src="./js/sentimentLeft.js"></script>
    <script src="./js/advImages.js"></script>
    <script src="./js/LAreaData2.js"></script>
    <script src="./js/jquery.my-message.1.1.js"></script>
    <script type="text/x-jquery-tmpl" id="merchants-detail-left">
          {{each newsAttrInfo}}
          <li>
            <table>
              <tr>
                <td><p style="width:60px;">{{= $value.name}}</p></td>
                <td><div style="width:176px;" class="sentimentright-city need-text-overflow"><span>{{= $value.province_name}} {{= $value.city_name}}</span></div></td>
                <td><div style="width:360px;" class="sentimentright-city need-text-overflow"><span>{{= $value.consult_text}}</span></div></td>
                <td align="center"><p style="width:120px;">{{= $value.store_area}}平方米</p></td>
                <td align="center"><p style="width:82px;"><button>{{= $value.quality_amount}}万</button></p></td>
              </tr>
            </table>
            </li>
      {{/each}}
    </script>
    <script type="text/x-jquery-tmpl" id="merchants-detail-right">
      {{each consultation}}
        <li>
          <table>
            <tr>
              <td><p style="width:53px;">{{= $value.name}}</p></td>
              <td><div style="width:120px;" class="sentimentright-city need-text-overflow"><span>{{= $value.province}} {{= $value.city}}</span></div></td>
              <td><div style="width:260px;" class="sentimentright-city need-text-overflow"><span>{{= $value.title}}</span></div></td>
              <td align="center"><p style="width:100px;"><button class="sentimentright-consult">我也要咨询</button></p></td>
            </tr>
          </table>
        </li>
      {{/each}}
    </script>
    <script type="text/x-jquery-tmpl" id="popularity-item">
      {{each merchants}}
        <div class="popularity-item" id="{{= $value.id}}">
          <div class="popularity-item-img">
            <img class="popularity-item-img" src="{{= ($value.img[0].indexOf('http'))>-1?$value.img[0]:imgURL + $value.img[0]}}" alt="">
          </div>
          <div class="popularity-item-title need-text-overflow"><span>{{= $value.title}}</span></div>
          <div class="popularity-item-location need-text-overflow"> <img class="popularity-item-icon" src="./image/icon/popularity-item-location.png" /> <span>{{= $value.join_region}}</span></div>
        </div>
      {{/each}}
    </script>
    <script type="text/x-jquery-tmpl" id="hot-merchantsJoin">
      {{each brand_join.joinInfo}}
        <li>
          {{= $value.province_name}}{{= $value.city_name}}{{= $value.county_name}}{{= $value.name}}提交了信息
        </li>
      {{/each}}
    </script>
    <script type="text/x-jquery-tmpl" id="select-city">
      <select id="provArea" onchange="showCity(this)">
        <option value="省份">省份</option>
      </select>
      <select id="cityArea" onchange="showCountry(this)">
          <option value="市区">市区</option>
      </select>
      <select id="countryArea">
          <option value="区/县">区/县</option>
      </select>
    </script>
    <script type="text/x-jquery-tmpl" id="footer-city">
      <select id="provAreaFooter" onchange="showCityFooter(this)">
        <option value="代理省份">代理省份</option>
      </select>
      <select id="cityAreaFooter" onchange="showCountryFooter(this)">
          <option>代理市区</option>
      </select>
      <select id="countryAreaFooter">
          <option>代理区/县</option>
      </select>
    </script>
    <script type="text/javascript">
      $(function () {
        showSuspension = true
        initBanner()
        var api = new ajax('GET', '/api/investProm/index')
        api.then(function (res) {
          init(JSON.parse(res).data)
        })
      })
      function initBanner() {
        onImgchange()
        window.onresize = function () {
          onImgchange()
        }
        initTopCarousel(carouselImg, $('.top-carousel'))
        initHotBrandItem(hotBrandImages, $('#hot-brand-item-container'))
        initMidBanner(merchantsImgsfirst, 4, $('#banner-wrapper'))
        initMidBanner(merchantsImgssecond, 4, $('#banner-wrapper2'))
        initMidBanner(merchantsImgsthird, 4, $('#banner-wrapper3'))
        initMidBanner(merchantsImgsfourth, 4, $('#banner-wrapper4'))
        initbigBanner(merchantsImgsfifth, 4, $('#merchants-img'))
        initMidBanner(merchantsImgssixth, 4, $('#merchants-img-small'))
        initbigBanner(merchantsImgsfifth, 4, $('#merchants-img-footer'))
        initMidBanner(merchantsImgsseventh, 4, $('#merchants-img-smallfooter'))
        $(window).scroll(function () {
          //变量scrollTop是滚动条滚动时，距离顶部的距离
          var scrollTop =
            document.documentElement.scrollTop || document.body.scrollTop
          //变量windowHeight是可视区的高度
          var windowHeight =
            document.documentElement.clientHeight || document.body.clientHeight
          //变量scrollHeight是滚动条的总高度
          var scrollHeight =
            document.documentElement.scrollHeight || document.body.scrollHeight
          //滚动条到底部的条件
          var cooperationForm = $('#cooperationForm')
          var brandJoinright = $('.brand-join-right')
          if (
            scrollTop + windowHeight == scrollHeight &&
            cooperationForm.is(':visible')
          ) {
            cooperationForm.css('bottom', '100px')
          } else {
            cooperationForm.css('bottom', '0')
          }
          if (scrollTop >= 350 && showSuspension) {
            brandJoinright.show()
          } else {
            brandJoinright.hide()
          }
        })
      }
      function onImgchange() {
        var windowWidth = $('body').width()
        var carouselBanner = $('.carousel-banner')
        var pageMidbanner = $('.page-mid-banner')
        carouselBanner.css('height', (558 / 1903) * windowWidth + 'px')
        pageMidbanner.css('height', (262 / 1903) * windowWidth + 'px')
      }
      function init(data) {
        // $('#header-page').load('header.html')
        initBrand(data.popularity_join, 4, $('#brand-wrapper'))
        $('#join-number').text(data.brand_join.number)

        // $('#merchants-img')
        //   .tmpl(merchantsimgData)
        //   .appendTo('#div-merchants-img')
        $('#merchants-detail-left')
          .tmpl(data)
          .appendTo('#div-merchantsDetail-left')
        $('#merchants-detail-right')
          .tmpl(data)
          .appendTo('#div-merchantsDetail-right')
        // $('#merchants-img')
        //   .tmpl(merchantsimgData)
        //   .appendTo('#div-merchants-imgtop')
        $('#popularity-item').tmpl(data).appendTo('#popularity-container')
        $('#hot-merchantsJoin').tmpl(data).appendTo('#div-hot-merchantsJoin')
        $('#select-city').tmpl().appendTo('#div-select-city')
        $('#footer-city').tmpl().appendTo('#div-footer-city')
        var scrollTop =
          $('#hot-merchantsJoin-box').offset().top -
          document.documentElement.scrollTop
        if (Math.round(scrollTop) < 0 || Math.round(scrollTop) > 2) {
          var timer = ''
          if (timer) {
            return false
          }
          $('#brand-join-img').click(function () {
            timer = setTimeout(function () {
              $('html,body').animate(
                { scrollTop: $('#hot-merchantsJoin-box').offset().top },
                200
              )
              timer = ''
            }, 200)
          })
        }
        $('.sentimentright-consult').click(function () {
          $('html,body').animate(
            { scrollTop: $('#hot-merchantsJoin-box').offset().top - 30 },
            800
          )
        })
        //最新招商信息 滚动
        $('.myscroll').myScroll({
          speed: 40, //数值越大，速度越慢
          rowHeight: 38, //li的高度
        })
        //品牌招商 滚动
        $('.join-scroll').myScroll({
          speed: 60, //数值越大，速度越慢
          rowHeight: 30, //li的高度
        })
        $('.sentiment-right ul li').hover(
          function () {
            $(this).css({
              color: '#EB3700',
              background: '#FFF5E5',
              borderLeft: 'solid #EB3700 3px',
              // boxShadow: '0px 5px 5px #EEC278'
            })
            $(this).find('button').css({
              color: '#ffffff',
              background: '#EB3700',
              border: 'solid #EB3700 1px',
            })
          },
          function () {
            $(this).css({
              color: '#333333',
              background: '#ffffff',
              borderLeft: 'solid transparent 3px',
              boxShadow: '0',
            })
            $(this).find('button').css({
              color: '#eb3700',
              background: '#fff',
              border: 'solid #e5e5e5 1px',
            })
          }
        )
        initSentimentLeft(data.popularity, 8, $('#sentiment-left'))
        // 初始化 品牌招商 全部省份信息
        var len = city.length
        for (var i = 0; i < len; i++) {
          var provOpt = document.createElement('option')
          var provFooterOpt = document.createElement('option')
          provOpt.innerText = provFooterOpt.innerText = city[i]['name']
          provOpt.value = provFooterOpt.value = city[i]['id']
          provArea.appendChild(provOpt)
          provAreaFooter.appendChild(provFooterOpt)
        }
        var params = getURLParams()
        if (params.consult) {
          $('html,body').animate(
            { scrollTop: $('#hot-merchantsJoin-box').offset().top - 30 },
            800
          )
        }
      }
      function initMidBanner(data, num, parent) {
        var el = ''
        for (key in data) {
          var flag = (+key + 1) % num
          var currentData = data[key]
          var temp =
            '<a target="_blank" href="' +
            currentData.link +
            '"rel="nofollow">' +
            '<div class="mid-banner" style="background: url(' +
            currentData.url +
            '); ' +
            (flag ? '' : 'margin-right:0;') +
            '"></div></a>'
          el += temp
        }
        parent.append(el)
      }
      function initbigBanner(data, num, parent) {
        var el = ''
        for (key in data) {
          var flag = (+key + 1) % num
          var currentData = data[key]
          var temp =
            '<a target="_blank" href="' +
            currentData.link +
            '" rel="nofollow">' +
            '<div class="big-banner" style="background: url(' +
            currentData.url +
            '); ' +
            (flag ? '' : 'margin-right:0;') +
            '"></div></a>'
          el += temp
        }
        parent.append(el)
      }
      function initHotBrandItem(data, parent) {
        var el = ''
        for (key in data) {
          var currentData = data[key]
          var temp =
            '<div class="hot-brand-item"><a href="' +
            currentData.link +
            '" target="_blank" rel="nofollow"><img src="' +
            (currentData.url || './image/not_found/hot_brand_item.jpg') +
            '"/></a></div>'
          el += temp
        }
        parent.append(el)
        initTopCarousel(carouselBanner, $('.sentiment-carousel'))
      }
      function initBrand(data, num, parent) {
        var el = ''
        for (key in data) {
          var flag = (+key + 1) % num
          var currentData = data[key]
          var temp = [
            '<div id="' +
              currentData.id +
              '" class="brand" ' +
              (flag ? '' : 'style="margin-right:0"') +
              '>',
            '  <img class="brand-tag" src="./image/picture/brand_tag.png" >',
            '  <div class="brand-img">',
            '    <img class="brand-img" src="' +
              (currentData.img[0].indexOf('http') > -1
                ? currentData.img[0]
                : imgURL + currentData.img[0]) +
              '" alt="" />',
            '  </div>',
            '  <div class="brand-text need-text-overflow">' + currentData.title,
            '  </div>',
            '</div>',
          ].join('')
          el += temp
        }
        parent.append(el)
        $('.brand').click(function (e) {
          go('JoininDetails.html?id=' + e.currentTarget.id)
        })
      }
      $('#closeCooperation').click(function () {
        $('#cooperationForm').slideUp('slow', function () {
          $('.footer').animate(
            {
              marginTop: 40,
            },
            50
          )
        })
      })
      $('.title-more').click(function () {
        go('merchantsJoinList.html')
      })
      $('#brand-close').click(function () {
        $('.brand-join-right').hide()
        showSuspension = false
      })
      $('#popularity-container').delegate(
        '.popularity-item',
        'click',
        function (e) {
          go('JoininDetails.html?id=' + e.currentTarget.id)
        }
      )

      function showCity(obj) {
        onchangeCity(obj, cityArea, countryArea)
      }
      function showCityFooter(obj) {
        onchangeCity(obj, cityAreaFooter, countryAreaFooter)
      }
      function onchangeCity(obj, cityData, countryData) {
        // 清除子节点
        var childs = cityData.childNodes
        for (var y = childs.length - 1; y >= 0; y--) {
          cityData.removeChild(childs[y])
        }
        var countryChilds = countryData.childNodes
        for (var z = countryChilds.length - 1; z >= 0; z--) {
          countryData.removeChild(countryChilds[z])
        }
        var val = obj.options[obj.selectedIndex].value
        var len = city.length
        for (var i = 0; i < len; i++) {
          if (city[i]['id'] === val) {
            for (var j = 0; j < city[i]['child'].length; j++) {
              // 创建市区下拉列表
              var provOpt = document.createElement('option')
              provOpt.innerText = city[i]['child'][j]['name']
              provOpt.value = city[i]['child'][j]['id']
              cityData.appendChild(provOpt)
              // 赋值默认市区 县区
              cityData.options[cityData.selectedIndex].value =
                city[i]['child'][0]['id']
              cityData.options[cityData.selectedIndex].innerText =
                city[i]['child'][0]['name']
              // countryData.options[countryData.selectedIndex].value =
              //   city[i]['child'][0]['child'][0]['id']
              // countryData.options[countryData.selectedIndex].innerText =
              //   city[i]['child'][0]['child'][0]['name']
            }
            // 创建县区下拉列表
            for (var o = 0; o < city[i]['child'][0]['child'].length; o++) {
              var countryOpt = document.createElement('option')
              countryOpt.innerText = city[i]['child'][0]['child'][o]['name']
              countryOpt.value = city[i]['child'][0]['child'][o]['id']
              countryData.appendChild(countryOpt)
            }
          }
        }
      }
      function showCountry(obj) {
        onchangeCountry(obj, countryArea, provArea)
      }
      function onchangeCountry(obj, countryData, provData) {
        // 清除子节点
        var childs = countryData.childNodes
        for (var i = childs.length - 1; i >= 0; i--) {
          countryData.removeChild(childs[i])
        }
        var val = obj.options[obj.selectedIndex].value
        // 找到省级值
        var provVal = provData.options[provData.selectedIndex].value
        var len = city.length
        for (var i = 0; i < len; i++) {
          if (city[i]['id'] === provVal) {
            for (var j = 0; j < city[i]['child'].length; j++) {
              if (city[i]['child'][j]['id'] === val) {
                for (var o = 0; o < city[i]['child'][j]['child'].length; o++) {
                  // 创建县区下拉列表
                  var provOpt = document.createElement('option')
                  provOpt.innerText = city[i]['child'][j]['child'][o]['name']
                  provOpt.value = city[i]['child'][j]['child'][o]['id']
                  countryData.appendChild(provOpt)
                }
              }
            }
          }
        }
      }
      function showCountryFooter(obj) {
        onchangeCountry(obj, countryAreaFooter, provAreaFooter)
      }
      // 提交加盟信息
      $('#form-submit').click(function () {
        formSubmit(your_name, your_tel, provArea, cityArea, countryArea, 0)
      })
      // 提交底部加盟信息
      $('#form-submit-footer').click(function () {
        formSubmit(
          your_nameFooter,
          your_telFooter,
          provAreaFooter,
          cityAreaFooter,
          countryAreaFooter,
          1
        )
      })
      // 提交加盟信息接口
      function formSubmit(
        name,
        tel,
        provAreaData,
        cityAreaData,
        countryAreaData,
        type
      ) {
        var nameTest = /^(?:[\u4e00-\u9fa5]+)(?:●[\u4e00-\u9fa5]+)*$|^[a-zA-Z0-9]+\s?[\.·\-()a-zA-Z]*[a-zA-Z]+$/
        var phoneTest = /(^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$)|(^0?[1][3-9 ][0-9]{9}$)/
        if (!nameTest.test(name.value)) {
          addMessage('姓名输入有误，请重新输入！', 'error')
          return false
        }
        if (!phoneTest.test(tel.value)) {
          addMessage('联系方式输入有误，请重新输入！', 'error')
          return false
        }

        if (
          !provAreaData.options[provAreaData.selectedIndex].value ||
          !cityAreaData.options[cityAreaData.selectedIndex].value ||
          !countryAreaData.options[countryAreaData.selectedIndex].value ||
          provAreaData.options[provAreaData.selectedIndex].value === '省份' ||
          provAreaData.options[provAreaData.selectedIndex].value === '代理省份'
        ) {
          addMessage('代理省份有误，请重新输入！', 'error')
          return false
        }
        var params = {
          your_name: name.value,
          your_tel: tel.value,
          province_code: provAreaData.options[provAreaData.selectedIndex].value,
          province_name:
            provAreaData.options[provAreaData.selectedIndex].innerText,
          city_code: cityAreaData.options[cityAreaData.selectedIndex].value,
          city_name: cityAreaData.options[cityAreaData.selectedIndex].innerText,
          county_code:
            countryAreaData.options[countryAreaData.selectedIndex].value,
          county_name:
            countryAreaData.options[countryAreaData.selectedIndex].innerText,
        }
        var api = new ajax('POST', '/api/investProm/setSave', params)
        api.then(function (res) {
          var re = JSON.parse(res)
          if (re.code === 1) {
            addMessage(re.msg, 'success')
            if (type) {
              $('#your_nameFooter').val('')
              $('#your_telFooter').val('')
              $('#provAreaFooter').val('代理省份')
              $('#cityAreaFooter').find('option').remove()
              $('#cityAreaFooter').append('<option>代理市区</option>')
              $('#countryAreaFooter').find('option').remove()
              $('#countryAreaFooter').append('<option>代理区/县</option>')
            } else {
              $('#your_name').val('')
              $('#your_tel').val('')
              $('#provArea').val('省份')
              $('#cityArea').find('option').remove()
              $('#cityArea').append('<option>市区</option>')
              $('#countryArea').find('option').remove()
              $('#countryArea').append('<option>区/县</option>')
            }
          } else {
            addMessage(JSON.parse(res).msg, 'error')
          }
        })
      }
    </script>
  </body>
</html>
